FROM python:3.10

MAINTAINER Huang Jintao

RUN mkdir -p /ctba/core/logs \
    /ctba/core/temp \
    /ctba/skywalking/agent \
    /ctba/core/python \
    /usr/local/java

WORKDIR /ctba/core

ENV SERVER_PORT=10000 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""

EXPOSE ${SERVER_PORT}

ADD ./target/ctba-core.jar ./app.jar
ADD ./openjdk-17_35_linux-x64_bin.tar.gz /usr/local/java/


# 配置java环境变量
ENV JAVA_HOME /usr/local/java/jdk-17
ENV CLASSPATH $JAVA_HOME/bin/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH
ENV PATH $JAVA_HOME/bin:$PATH

ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
           #-Dskywalking.agent.service_name=ctba-core \
           #-javaagent:/ctba/skywalking/agent/skywalking-agent.jar \
           -jar app.jar \
           -XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*,:time,tags,level -XX:+UseZGC ${JAVA_OPTS}

